<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    

      

       <script>  
                
              let dataList=[
                  {
                      name:"xiaohei",
                      score:55,
                  },
                  {
                      name:"xiaoming",
                      score:66,
                  },
                  {
                      name:"xiaohong",
                      score:77,
                  },
                  {
                      name:"xiaofang",
                      score:88,
                  }
              ]
              dataList.forEach((item)=>{
                   if(item.score==66){
                       throw '跳出循环'
                   }
                   console.log(111111)
              })
              //跳出 forEach 循环 我们可以抛出一个错误





     

       </script>

</body>
</html>